import pysolr



if __name__ == '__main__':
    zookeeper = pysolr.ZooKeeper("CDH-master:2181,CDH-slave1:2181,CDH-slave2:2181/solr")
    solr_con =  pysolr.SolrCloud(zookeeper,"hbaseSolr")
    #更新就是重新添加一次
    doc = {
        "id": "row995",
        "name": "a",
        "city": "s",
        "salary": "9"
    }
    # add中必须是列表
    solr_con.add([doc])
    print('更新成功！')